using Distributed

function putter(c::Channel)
    println("putting...")
    for i = 1:5
        put!(c, i)
        t = rand()
        println("Put ", i, "\t sleep ", t)
        sleep(t)
    end
end

function taker(c::Channel)
    println("taking...")
    while true
        x = 0
        t = @elapsed x = take!(c)
        println("Take ", x, "\t elapsed ", t)
    end
end


c = Channel(2)

 @async taker(c)

putter(c)

 read(stdin, Char)
